package com.easyUploader.entity.vo;


import com.common.util.StringUtil;
import com.common.validator.CustomNotEmpty;
import com.easyUploader.property.LocalFileProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 大忽悠
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ApiModel("目录对象")
public class DirectoryVo {
   @ApiModelProperty("目录路径")
   @CustomNotEmpty(message = "目录路径不能为空")
   private String directoryPath;
   @ApiModelProperty("桶名--可以为空,则选择default桶")
   private String bucketName;

   public String getBucketName() {
      return StringUtil.isNullOrEmpty(bucketName)? LocalFileProperty.DEFAULT_BUCKET :bucketName;
   }
}
